<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智能情绪交互平台登录</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            background: linear-gradient(135deg, 
                #E6F7F2 0%,    
                #BFF2D9 33%,   
                #D6F8F0 50% 
            );
            background-size: 400% 400%;
            animation: seaWave 15s ease infinite;
        }

        @keyframes seaWave {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        .login-container {
            background: rgba(255, 255, 255, 0.1);
            padding: 2.5rem;
            border-radius: 20px;
            box-shadow: 0 8px 32px rgba(0, 79, 128, 0.3);
            backdrop-filter: blur(12px);
            width: 90%;
            max-width: 420px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            transform-style: preserve-3d;
            perspective: 1000px;
        }

        h2 {
            color: #4a90e2;
            margin-bottom: 2rem;
            font-size: 2.2rem;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            background: linear-gradient(45deg, #a8e6ff, #4a90e2);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .form-group {
            margin: 2rem 0;
            position: relative;
        }

        .form-group label {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: rgba(102, 102, 102, 0.7); /* 调整标签颜色 */
            transition: all 0.3s ease;
            pointer-events: none;
        }

        .form-group input {
            width: 100%;
            padding: 1.2rem;
            font-size: 1.1rem;
            border: none;
            border-radius: 8px;
            background: white; 
            color: #000000;
            transition: all 0.3s ease;
        }

        /* 调整占位符颜色 */
        .form-group input::placeholder,
        .form-group input:-webkit-input-placeholder,
        .form-group input::-moz-placeholder,
        .form-group input:-ms-input-placeholder {
            color: #666666;
            opacity: 1;
        }

        .form-group input:focus {
            outline: none;
            box-shadow: 0 0 0 2px #64ffda; 
            background: white; 
        }

        .form-group input:focus + label,
        .form-group input:not(:placeholder-shown) + label {
            top: -10px;
            left: 0.8rem;
            font-size: 0.9rem;
            color: #4a90e2;
        }

        .login-btn {
            background: linear-gradient(45deg, #a8e6ff, #4a90e2);
            color: white;
            border: none;
            padding: 1rem 2rem;
            border-radius: 8px;
            font-size: 1.1rem;
            cursor: pointer;
            width: 100%;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .login-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(100, 255, 218, 0.4);
        }

        .error-message {
            color: #ff6b6b;
            margin-top: 1.5rem;
            padding: 1rem;
            background: rgba(255, 107, 107, 0.1);
            border-radius: 6px;
            animation: shake 0.4s ease;
            display: none;
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-8px); }
            75% { transform: translateX(8px); }
        }
    </style>
</head>
<body>
    <div class="login-container">
        <h2>小爱助手</h2>
        <form id="loginForm">
            <div class="form-group">
                <input type="text" id="username" required placeholder="">
                <label for="username">用户名</label>
            </div>
            <div class="form-group">
                <input type="password" id="password" required placeholder="">
                <label for="password">密码</label>
            </div>
            <button type="submit" class="login-btn">立即起飞</button>
            <div class="error-message" id="errorMessage"></div>
        </form>
    </div>

    <script>
        document.getElementById('loginForm').addEventListener('submit', function(e) {
            e.preventDefault(); 
            
            const username = document.getElementById('username').value;
            const password = document.getElementById('password').value;
            const errorMessage = document.getElementById('errorMessage');

            if (username === 'admin' && password === '123456') {
                window.location.href = 'operation.html';
            } else {
                errorMessage.style.display = 'block';
                errorMessage.textContent = '认证失败，请检查您的通行凭证';
                
                errorMessage.style.animation = 'none';
                void errorMessage.offsetWidth; 
                errorMessage.style.animation = 'shake 0.4s ease';
            }
        });

        document.querySelectorAll('input').forEach(input => {
            input.addEventListener('input', () => {
                document.getElementById('errorMessage').style.display = 'none';
            });
        });
    </script>
</body>
</html>